<template>
  <div class="orderTable">
    <div class="queryOrder">
      <span>当前共查询到<i  class="inquire"> xx </i>条订单,总订单额度<i class="limit"> xxx </i>元</span>
      <el-button type="text" @click="dialogVisibleFn" class="AddBtn">添加订单</el-button>
    </div>
    <el-table :data="tableData" border style="width: 100%">
      <el-table-column fixed prop="date" label="典礼时间" width="150">
      </el-table-column>
      <el-table-column prop="name" label="主持人" width="120">
      </el-table-column>
      <el-table-column prop="province" label="酒店名称酒店地址" width="200">
      </el-table-column>
      <el-table-column prop="city" label="下单时间" width="200">
      </el-table-column>
      <el-table-column prop="address" label="金额" width="100">
      </el-table-column>
      <el-table-column prop="zip" label="订单状态" width="120">
      </el-table-column>
      <el-table-column prop="remark" label="备注" width="260">
      </el-table-column>
      <el-table-column label="操作" fixed="right" width="120">
        <template slot-scope="scope">
          <el-button
            @click.native.prevent="deleteRow(scope.$index, tableData)"
            type="text"
            size="small"
          >
            移除
          </el-button>
        </template>
      </el-table-column>
    </el-table>
    <AddOrder />
  </div>
</template>

<script>
import AddOrder from "./AddOrder";

export default {
  data() {
    return {
      dialogVisible: false,
      tableData: [
        {
          date: "2016-05-02",
          name: "王小虎",
          province: "上海",
          city: "普陀区",
          address: "上海市普陀区",
          zip: 200333,
          remark: "啊实打实的",
        },
        {
          date: "2016-05-02",
          name: "王小虎",
          province: "上海",
          city: "普陀区",
          address: "上海市普陀区",
          zip: 200333,
          remark: "啊实打实的",
        },
        {
          date: "2016-05-02",
          name: "王小虎",
          province: "上海",
          city: "普陀区",
          address: "上海市普陀区",
          zip: 200333,
          remark: "啊实打实的",
        },
      ],
    };
  },
  components: {
    AddOrder,
  },
  methods: {
    dialogVisibleFn() {
      console.log(111);
      this.$bus.$emit("dialogVisible", true);
    },
    deleteRow(index, rows) {
      rows.splice(index, 1);
    },
  },
};
</script>

<style scoped lang="less">
.queryOrder {
  width: 100%;
}
.AddBtn{
    margin-left: 900px;
}
</style>